﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Windows.Foundation.Collections;
using Xiaowei.Services;

namespace Xiaowei.AppServiceResponseHandlers
{
    public static class AppServiceResponseRegister
    {
        public static void RegisterFunctions()
        {
            Services.AppServiceManager.Instance.RegisterFunction("MvaWakeupConfirmed", MvaAppServiceResponseHandler.RequestMvaWakeupConfirmed);
            Services.AppServiceManager.Instance.RegisterFunction("RequestQrCodeUpdate", (vs) =>
            {
                XiaoweiAI.Instance.RequestQrCodeUpdate();
                return null;
            });
            XiaoweiAI.Instance.QrCodeChanged += (path) =>
            {
                ValueSet msg = new ValueSet();
                msg.Add("Request", "QrCodeChanged");
                msg.Add("path", path);
                Services.AppServiceManager.Instance.SendMessage(msg);
            };
        }
    }
}
